#include "Hill.h"

StaticTrimesh* createHill(dSpaceID &space)
{
	std::vector<Vertex> vertices;
	std::vector<GLuint> indices;

	/* Hill Verts
	{-1.0,  0.0, -1.0, 0.0}
	{ 1.0,  0.0, -1.0, 0.0}
	{ 1.0,  0.0,  1.0, 0.0}
	{-1.0,  0.0,  1.0, 0.0}
	{ 0.0,  1.0,  0.0, 0.0}
	*/

	Vertex firstVert;
	firstVert.position = cml::vector3f(-1.0f,  0.0f, -1.0f);
	firstVert.normal = cml::vector3f(-1.0f, 1.0f, -1.0f).normalize(); //PLACEHOLDER
	vertices.push_back(firstVert);

	Vertex secondVert;
	secondVert.position = cml::vector3f( 1.0f,  0.0f, -1.0f);
	secondVert.normal = cml::vector3f(1.0f, 1.0f, -1.0f).normalize(); //PLACEHOLDER
	vertices.push_back(secondVert);

	Vertex thirdVert;
	thirdVert.position = cml::vector3f( 1.0f,  0.0f,  1.0f);
	thirdVert.normal = cml::vector3f(1.0f, 1.0f, 1.0f).normalize(); //PLACEHOLDER
	vertices.push_back(thirdVert);

	Vertex fourthVert;
	fourthVert.position = cml::vector3f(-1.0f,  0.0f,  1.0f);
	fourthVert.normal = cml::vector3f(-10.0f, 1.0f, 1.0f).normalize(); //PLACEHOLDER
	vertices.push_back(fourthVert);

	Vertex topVert;
	topVert.position = cml::vector3f( 0.0f,  1.0f,  0.0f);
	topVert.normal = cml::vector3f(0.0f, 1.0f, 0.0f); //PLACEHOLDER
	vertices.push_back(topVert);

	/* Hill Indices
	{4, 1, 0}
	{4, 0, 3}
	{4, 3, 2}
	{4, 2, 1}
	*/

	indices.push_back(4); indices.push_back(1); indices.push_back(0);
	indices.push_back(4); indices.push_back(0); indices.push_back(3);
	indices.push_back(4); indices.push_back(3); indices.push_back(2);
	indices.push_back(4); indices.push_back(2); indices.push_back(1);

	return new StaticTrimesh(space, vertices, indices);
}